<!-- target:detail -->
<div class="flex-cont grey-bg" ui="type:m-panel;">
    <!-- var:selfContract = ${detail.financeIncome.contractType} === 4 -->
    <div class="detail-title">
        <div class="title-text">${detail.financeIncome.projectContent}（${detail.financeIncome.unifiedId})</div>
        <!-- if:${detail.auditState} == 1 -->
        <div class="title-tip">等待${detail.approval.currentApproverName}处理</div>
        <!-- else -->
        <div class="title-tip">${detail.auditStateDesc}</div>
        <!-- /if -->
    </div>

    <!-- var:contractInfo = ${contractInfo} || ${detail.contractInfo} -->
    <div class="info-part">
        <div class="info-item">
            <div class="info-label">项目模式</div>
            <div class="info-text">${contractInfo.projectPatternDesc}模式</div>
        </div>
        <!-- if:${contractInfo.type} !== 4 -->
        <div class="info-item">
            <div class="info-label">客户名称</div>
            <div class="info-text">${contractInfo.sponsorName}</div>
        </div>
        <!-- /if -->
        <div class="info-item">
            <div class="info-label">预订门店</div>
            <div class="info-text">${contractInfo.venueName}-${contractInfo.yardName}</div>
        </div>
        <div class="info-item">
            <div class="info-label">合同编号</div>
            <div class="info-text">${contractInfo.contractNo}</div>
        </div>
        <div class="info-item">
            <div class="info-label">使用时间</div>
            <div class="info-text">${contractInfo.startTime|dateFormat('yyyy-MM-dd HH:mm:ss')}</div>
        </div>
    </div>

    <div class="info-part">
        <div class="info-item">
            <div class="info-label">票房总计</div>
            <div class="info-text">${detail.settlementInfo.ticket.ticketSumOfMoney}</div>
        </div>
        <div class="info-item">
            <div class="info-label">门票含酒水费用</div>
            <div class="info-text">${detail.settlementInfo.ticket.otherCostsSumOfMoney}</div>
        </div>
        <div class="info-item">
            <div class="info-label">实际票房总额</div>
            <div class="info-text">${detail.settlementInfo.ticket.actualTicketIncomeMoney}</div>
        </div>
        <!-- if:!${selfContract} -->
        <div class="info-item">
            <div class="info-label">场馆${detail.settlementInfo.ticket.weProportion}%</div>
            <div class="info-text">${detail.settlementInfo.ticket.venueIncomeMoney}</div>
        </div>
        <div class="info-item">
            <div class="info-label">主办方${detail.settlementInfo.ticket.otherProportion}%</div>
            <div class="info-text">${detail.settlementInfo.ticket.sponsorIncomeMoney}</div>
        </div>
        <!-- /if -->
    </div>

    <!-- var: saleInventory = ${detail.settlementInfo.saleInventory} -->

    <!-- if:true || ${saleInventory.drinksDivision} === 2 -->
    <div class="info-part">
        <div class="info-item">
            <div class="info-label">酒水总计={${saleInventory.divisionType} === 1 ? '毛利' : '营业额'}</div>
            <div class="info-text">={${saleInventory.divisionType} === 1 ? ${saleInventory.totalProfitMoney} : ${saleInventory.drinksSumOfMoney}}</div>
        </div>
        <div class="info-item">
            <div class="info-label">酒水成本</div>
            <div class="info-text">${saleInventory.barCost}</div>
        </div>
        <div class="info-item">
            <div class="info-label">场馆${saleInventory.weProportion}%</div>
            <div class="info-text">${saleInventory.venueIncomeMoney}</div>
        </div>
        <div class="info-item">
            <div class="info-label">主办方${saleInventory.otherProportion}%</div>
            <div class="info-text">${saleInventory.sponsorIncomeMoney}</div>
        </div>
    </div>
    <!-- /if -->


    <div class="info-part">
        <div class="info-item">
            <div class="info-label">结算</div>
        </div>
        
        <!-- var:receivedDetailedList = ${detail.settlementInfo.settlementDetailed.receivedDetailedList} -->
        <!-- var:total = 0 -->
        <!-- for:${receivedDetailedList} as ${item},${index} -->
        <!-- var:_index = ${index} + 1 -->
        <!-- var:total = mao.util.toFixed(${total}) + mao.util.toFixed(${item.money}) -->
        <div class="info-item info-item-title">已收项${_index}</div>
        <div class="info-item level-2">
            <div class="info-label">收入类别</div>
            <!-- if:${selfContract} -->
            <div class="info-text">${item.incomeCode|parseBaseInfo('financeSelfIncomeCode')}</div>
            <!-- else -->
            <div class="info-text">${item.incomeCode|parseBaseInfo('financeIncomeCode')}</div>
            <!-- /if -->
        </div>
        <div class="info-item level-2">
            <div class="info-label">收入明细</div>
            <div class="info-text">${item.name}</div>
        </div>
        <div class="info-item level-2">
            <div class="info-label">金额</div>
            <div class="info-text">${item.money|fixed}元</div>
        </div>
        <!-- /for -->

        <div class="info-item level-2 total-item">
            <div class="info-label">={${selfContract} ? '收入合计' : '已收合计'}<span style="float: right">${total|fixed}</span></div>
        </div>

        <!-- var:receivableDetailedList = ${selfContract} ? ${detail.settlementInfo.settlementDetailed.expenditureDetailedList} : ${detail.settlementInfo.settlementDetailed.receivableDetailedList} -->

        <!-- var:total = 0 -->
        <!-- for:${receivableDetailedList} as ${item},${index} -->
            <!-- if:${selfContract} !== 4 || (${selfContract} === 4 && ${item.source} !== 2)  -->
            <!-- var:total = ${total} + ${item.money} -->
            <!-- var:_index = ${index} + 1 -->
            <div class="info-item info-item-title">应收项${_index}</div>
            <div class="info-item level-2">
                <div class="info-label">收入类别</div>
                <!-- if:${selfContract} -->
                <div class="info-text">${item.incomeCode|parseBaseInfo('financeSelfIncomeCode')}</div>
                <!-- else -->
                <div class="info-text">${item.incomeCode|parseBaseInfo('financeIncomeCode')}</div>
                <!-- /if -->
            </div>
            <div class="info-item level-2">
                <div class="info-label">收入明细</div>
                <div class="info-text">${item.name}</div>
            </div>
            <div class="info-item level-2">
                <div class="info-label">金额</div>
                <div class="info-text">${item.money|fixed}元</div>
            </div>
            <!-- /if -->
        <!-- /for -->


        <div class="info-item level-2 total-item">
            <div class="info-label">={${selfContract} ? '支出合计' : '应收合计'}<span style="float: right">${total|fixed}</span></div>
        </div>

    </div>
    
    <!-- var:contactInfoTarget = ['', 'courtBusinessInfo', 'ticketBusinessInfo', 'businessInfo', 'selfBusinessInfo'][${contractInfo.type}] -->
    <!-- use:${contactInfoTarget} -->

    <!-- use:fileInfo -->
    <!-- use:approvalPeople -->
    <div class="blank-grey"></div>
</div>
<!-- use:bill.comment -->

<!-- target:comment -->
<!-- var:auditState = ${detail.auditState} !== undefined ? ${detail.auditState} : ${detail.contractInfo.auditState}; -->
<form class="operate-btn-box" name="commentForm">
    <input class="ui-hide" name="id" value="${detail.financeIncome.id}" />
    <input class="ui-hide" name="action" value="" />
    <label ui="type:NS.OrderCommentSave;" class="operate-input">
        <input class="text" type="text" placeholder="请输入" name="actionRemark" />
        <input class="submit-btn" type="button" disabled value="提交"/>
        <div class="btn-items">
            <strong type="text" class="btn-item comment-item" ui="module:${module};action:7">
                <span class="icon"></span>
                <span>评论</span>
            </strong>
            <div type="text" class="btn-item comment-item" ui="module:${module};action:7">
                <span class="icon more"></span>
                <span>更多</span>
            </div>
        </div>
    </label>
    <div class="operate-btns">
        <!-- if:${detail.approval.isCurrentApprover} -->
            <!-- if:${detail.financeIncome.auditState} === 1 -->
            <strong class="operate-btn refuse-btn" ui="type:mao.ui.ApprovalSubmitBtn;bType:4;cType:2;tip:审批已拒绝">拒绝</strong>
            <strong class="operate-btn agree-btn" ui="type:mao.ui.ApprovalSubmitBtn;bType:4;cType:3;tip:审批已同意">同意</strong>
            <!-- /if -->
        <!-- /if -->
    </div>
</form>

